<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>
  Class: Upstart::Exporter::Options::CommandLine
  
    &mdash; Documentation by YARD 0.7.4
  
</title>

  <link rel="stylesheet" href="../../../css/style.css" type="text/css" media="screen" charset="utf-8" />

  <link rel="stylesheet" href="../../../css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../../..';
  if (relpath != '') relpath += '/';
</script>

  <script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>


  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="../../../_index.html">Index (C)</a> &raquo; 
    <span class='title'><span class='object_link'><a href="../../../Upstart.html" title="Upstart (module)">Upstart</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../../Exporter.html" title="Upstart::Exporter (class)">Exporter</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Options.html" title="Upstart::Exporter::Options (module)">Options</a></span></span>
     &raquo; 
    <span class="title">CommandLine</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a id="class_list_link" href="#">Class List</a>
  
    <a id="method_list_link" href="#">Method List</a>
  
    <a id="file_list_link" href="#">File List</a>
  
</div>
      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Upstart::Exporter::Options::CommandLine
  
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Hash</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">Hash</li>
          
            <li class="next">Upstart::Exporter::Options::CommandLine</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
  
    
      <dt class="r2">Includes:</dt>
      <dd class="r2"><span class='object_link'><a href="../Errors.html" title="Upstart::Exporter::Errors (module)">Errors</a></span></dd>
      
    
  
  
  
    <dt class="r1 last">Defined in:</dt>
    <dd class="r1 last">lib/upstart-exporter/options/command_line.rb</dd>
  
</dl>
<div class="clear"></div>



  
  
  
  
  


  
  
  
  

  
    <h2>
      Instance Method Summary
      <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
    </h2>

    <ul class="summary">
      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (CommandLine) <strong>initialize</strong>(command_line_args) </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'><p>
A new instance of CommandLine.
</p>
</div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#process_appname-instance_method" title="#process_appname (instance method)">- (Object) <strong>process_appname</strong>(app_name) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
        <li class="public ">
  <span class="summary_signature">
    
      <a href="#process_procfile-instance_method" title="#process_procfile (instance method)">- (Object) <strong>process_procfile</strong>(name) </a>
    

    
  </span>
  
  
  
  
  
  

  
    <span class="summary_desc"><div class='inline'></div></span>
  
</li>

      
    </ul>
  


  
  
  
  
  
  
  
  <h3 class="inherited">Methods included from <span class='object_link'><a href="../Errors.html" title="Upstart::Exporter::Errors (module)">Errors</a></span></h3>
  <p class="inherited"><span class='object_link'><a href="../Errors.html#error-instance_method" title="Upstart::Exporter::Errors#error (method)">#error</a></span></p>

  <div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><span class='object_link'><a href="" title="Upstart::Exporter::Options::CommandLine (class)">CommandLine</a></span></tt>) <strong>initialize</strong>(command_line_args) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>
A new instance of CommandLine
</p>


  </div>
</div>
<div class="tags">
  

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


5
6
7
8
9
10
11
12
13</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/upstart-exporter/options/command_line.rb', line 5</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='rubyid_command_line_args identifier id'>command_line_args</span><span class='rparen token'>)</span>
  <span class='rubyid_super super kw'>super</span>
  <span class='rubyid_self self kw'>self</span><span class='lbrack token'>[</span><span class='symbol val'>:commands</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_if if kw'>if</span> <span class='rubyid_command_line_args identifier id'>command_line_args</span><span class='lbrack token'>[</span><span class='symbol val'>:clear</span><span class='rbrack token'>]</span>
    <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
  <span class='rubyid_else else kw'>else</span>
    <span class='rubyid_process_procfile identifier id'>process_procfile</span><span class='lparen token'>(</span><span class='rubyid_command_line_args identifier id'>command_line_args</span><span class='lbrack token'>[</span><span class='symbol val'>:procfile</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
  <span class='rubyid_end end kw'>end</span>
  <span class='rubyid_self self kw'>self</span><span class='lbrack token'>[</span><span class='symbol val'>:app_name</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_process_appname identifier id'>process_appname</span><span class='lparen token'>(</span><span class='rubyid_command_line_args identifier id'>command_line_args</span><span class='lbrack token'>[</span><span class='symbol val'>:app_name</span><span class='rbrack token'>]</span><span class='rparen token'>)</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
  
</div>


  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="process_appname-instance_method">
  
    - (<tt>Object</tt>) <strong>process_appname</strong>(app_name) 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


36
37
38
39</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/upstart-exporter/options/command_line.rb', line 36</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_process_appname identifier id'>process_appname</span><span class='lparen token'>(</span><span class='rubyid_app_name identifier id'>app_name</span><span class='rparen token'>)</span>
  <span class='rubyid_error identifier id'>error</span> <span class='dstring node'>&quot;Application name should contain only letters (and underscore) and be nonempty, so #{app_name.inspect} is not suitable&quot;</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_app_name identifier id'>app_name</span> <span class='match op'>=~</span> <span class='regexp val'>/^\w+$/</span> 
  <span class='rubyid_app_name identifier id'>app_name</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="process_procfile-instance_method">
  
    - (<tt>Object</tt>) <strong>process_procfile</strong>(name) 
  

  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File 'lib/upstart-exporter/options/command_line.rb', line 15</span>

<span class='rubyid_def def kw'>def</span> <span class='rubyid_process_procfile identifier id'>process_procfile</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='rparen token'>)</span>
  <span class='rubyid_error identifier id'>error</span> <span class='dstring node'>&quot;#{name} is not a readable file&quot;</span> <span class='rubyid_unless unless_mod kw'>unless</span> <span class='rubyid_FileTest constant id'>FileTest</span><span class='dot token'>.</span><span class='rubyid_file? fid id'>file?</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='rparen token'>)</span>
  <span class='rubyid_commands identifier id'>commands</span> <span class='assign token'>=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
  <span class='rubyid_content identifier id'>content</span> <span class='assign token'>=</span> <span class='rubyid_File constant id'>File</span><span class='dot token'>.</span><span class='rubyid_read identifier id'>read</span><span class='lparen token'>(</span><span class='rubyid_name identifier id'>name</span><span class='rparen token'>)</span>
  <span class='rubyid_content identifier id'>content</span><span class='dot token'>.</span><span class='rubyid_lines identifier id'>lines</span><span class='dot token'>.</span><span class='rubyid_each identifier id'>each</span> <span class='rubyid_do do kw'>do</span> <span class='bitor op'>|</span><span class='rubyid_line identifier id'>line</span><span class='bitor op'>|</span>
    <span class='rubyid_line identifier id'>line</span><span class='dot token'>.</span><span class='rubyid_chomp! fid id'>chomp!</span>
    <span class='rubyid_if if kw'>if</span> <span class='rubyid_line identifier id'>line</span> <span class='match op'>=~</span> <span class='regexp val'>/^(\w+?):(.*)$/</span>
      <span class='rubyid_label identifier id'>label</span> <span class='assign token'>=</span> <span class='rubyid_$1 nth_ref id'>$1</span>
      <span class='rubyid_command identifier id'>command</span> <span class='assign token'>=</span> <span class='rubyid_$2 nth_ref id'>$2</span>
      <span class='rubyid_commands identifier id'>commands</span><span class='lbrack token'>[</span><span class='rubyid_label identifier id'>label</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='rubyid_command identifier id'>command</span>
    <span class='rubyid_elsif elsif kw'>elsif</span> <span class='rubyid_line identifier id'>line</span> <span class='match op'>=~</span> <span class='regexp val'>/^\s*#/</span>
      <span class='comment val'># do nothing, comment</span>
    <span class='rubyid_elsif elsif kw'>elsif</span> <span class='rubyid_line identifier id'>line</span> <span class='match op'>=~</span> <span class='regexp val'>/^\s*$/</span>
      <span class='comment val'># do nothing, empty</span>
    <span class='rubyid_else else kw'>else</span>
      <span class='rubyid_error identifier id'>error</span> <span class='string val'>&quot;procfile lines should have the following format: 'some_label: command'&quot;</span>
    <span class='rubyid_end end kw'>end</span>
  <span class='rubyid_end end kw'>end</span>
  <span class='rubyid_commands identifier id'>commands</span>
<span class='rubyid_end end kw'>end</span>
</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Thu Dec 22 20:43:32 2011 by 
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.7.4 (ruby-1.8.7).
</div>

  </body>
</html>